document.body.insertAdjacentHTML("beforeend", "<h1>hello world</h1>");
const btn = document.createElement("button");
btn.textContent = "click me";
btn.onclick = () => {
  fetch("/api")
    .then((res) => res.text())
    .then((result) => {
      document.body.insertAdjacentHTML("beforeend", `<div>${result}</div>`);
    });
};
document.body.appendChild(btn);
